<template>
  <view>
    <view class="content">
      <view class="box">
        <kt-button ref="wechatWechatLoginBtn" @click="wechatMpLogin()">微信小程序登录</kt-button>
      </view>
    </view>
    <view class="content">
      <view class="box">
        <kt-button
            ref="googleWebLoginBtn"
            @click="googleWebLogin()">谷歌WEB登录
        </kt-button>
      </view>
    </view>

  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  onLoad() {
  },
  methods: {
    googleWebLogin(){

      this.$refs.googleWebLoginBtn.loading(null,0);

      this.$kt.thirdPartyLogin.googleWeb.login().then((res) => {
        console.log(res, 'res');
        this.$refs.googleWebLoginBtn.success(res.msg);
      }).catch((err) => {
        console.log(err, 'err');
        this.$refs.googleWebLoginBtn.error(err.errMsg);
      });
    },
    wechatMpLogin() {
      this.$refs.wechatWechatLoginBtn.loading();
      this.$kt.thirdPartyLogin.wechatMp.login().then((res) => {
        this.$refs.wechatWechatLoginBtn.success(res.msg);
      }).catch((err) => {
        this.$refs.wechatWechatLoginBtn.error(err.errMsg);
      });
    }
  }
}
</script>

<style lang="scss">
.content {
  padding: 30rpx;
}

.box {
  padding: 20rpx;
}
</style>